
// 致力于将所有的请求整合到一个文件中(api.js), 方便后期管理

import { ajaxPromise } from "./ajax.js";


const isExistUser = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/isExistUser.php",
    data: data,
    dataType: "json",
});
const isExistPhone = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/isExistPhone.php",
    data: data,
    dataType: "json",
});

const isExistEmail = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/isExistEmail.php",
    data: data,
    dataType: "json",
});

const register = data => ajaxPromise({
    type: "post",
    url: "http://121.43.116.41/demo/php/register.php",
    data: data,
    dataType: "json"
})

const loginAccount = data => ajaxPromise({
    type: "post",
    url: "http://121.43.116.41/demo/php/login_account.php",
    data: data,
    dataType: "json"
})

const searchGradeOrderLimit = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/searchGradeOrderLimit.php",
    data: data,
    dataType: "json",
});

const searchGradeById = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/searchGradeById.php",
    data: data,
    dataType: "json",
});

const deleteGradeById = data => ajaxPromise({
    type: "get",
    url: "http://121.43.116.41/demo/php/deleteGradeById.php",
    data: data,
    dataType: "json",
});

const updateGradeById = data => ajaxPromise({
    type: "post",
    url: "http://121.43.116.41/demo/php/updateGradeById.php",
    data: data,
    dataType: "json",
});


export {
    isExistUser,
    isExistPhone,
    isExistEmail,
    register,
    loginAccount,
    searchGradeOrderLimit,
    searchGradeById,
    deleteGradeById,
    updateGradeById,
}




